﻿/* 
    会员消费币商店
*/
//150级武器防具
var armorlist = new Array(
   // 外星碎片防具
    Array(1003893, 580, 70, 70, 70, 70, 30, 30, 20, 0, 0, 40601, 40291, 129902),
        // 鲁塔比斯防具
    Array(1003797, 1299, 50, 50, 50, 50, 10, 10, 12, 0, 0, 40601, 40291, 129902),
    Array(1003798, 1299, 50, 50, 50, 50, 10, 10, 12, 0, 0, 40601, 40291, 129902),
    Array(1003799, 1299, 50, 50, 50, 50, 10, 10, 12, 0, 0, 40601, 40291, 129902),
    Array(1003800, 1299, 50, 50, 50, 50, 10, 10, 12, 0, 0, 40601, 40291, 129902),
    Array(1003801, 1299, 50, 50, 50, 50, 10, 10, 12, 0, 0, 40601, 40291, 129902),
    Array(1042254, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1042255, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1042256, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1042257, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1042258, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1062165, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1062166, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1062167, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1062168, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
    Array(1062169, 1299, 40, 40, 40, 40, 10, 10, 8, 0, 0, 40601, 40291, 129902),
        // 暴君防具
    Array(1072743, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1072744, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1072745, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1072746, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1072747, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1082543, 800, 15, 15, 15, 15, 25, 45, 3, 0, 0, 40601, 40291, 129902),
    Array(1082544, 800, 15, 15, 15, 15, 25, 25, 3, 0, 0, 40601, 40291, 129902),
    Array(1082545, 800, 15, 15, 15, 15, 25, 25, 3, 0, 0, 40601, 40291, 129902),
    Array(1082546, 800, 15, 15, 15, 15, 25, 25, 3, 0, 0, 40601, 40291, 129902),
    Array(1082547, 800, 15, 15, 15, 15, 25, 25, 3, 0, 0, 40601, 40291, 129902),
    Array(1102481, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1102482, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1102483, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1102484, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1102485, 800, 50, 50, 50, 50, 40, 40, 3, 0, 0, 40601, 40291, 129902),
    Array(1132174, 800, 50, 50, 50, 50, 35, 35, 3, 0, 0, 40601, 40291, 129902),
    Array(1132175, 800, 50, 50, 50, 50, 35, 35, 3, 0, 0, 40601, 40291, 129902),
    Array(1132176, 800, 50, 50, 50, 50, 35, 35, 3, 0, 0, 40601, 40291, 129902),
    Array(1132177, 800, 50, 50, 50, 50, 35, 35, 3, 0, 0, 40601, 40291, 129902),
    Array(1132178, 800, 50, 50, 50, 50, 35, 35, 3, 0, 0, 40601, 40291, 129902)
);
//160级防具
var caplist = new Array(
        // 埃苏莱布斯防具
    Array(1152174, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1152176, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1152177, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1152178, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1152179, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1004422, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1004423, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1004424, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1004425, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1004426, 999, 70, 70, 70, 70, 20, 20, 14, 0, 0, 40601, 40291, 129902),
    Array(1102775, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1102794, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1102795, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1102796, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1102797, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1082636, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1082637, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1082638, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1082639, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1082640, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1052882, 999, 90, 90, 90, 90, 30, 30, 15, 0, 0, 40601, 40291, 129902),
    Array(1052887, 999, 90, 90, 90, 90, 30, 30, 15, 0, 0, 40601, 40291, 129902),
    Array(1052888, 999, 90, 90, 90, 90, 30, 30, 15, 0, 0, 40601, 40291, 129902),
    Array(1052889, 999, 90, 90, 90, 90, 30, 30, 15, 0, 0, 40601, 40291, 129902),
    Array(1052890, 999, 90, 90, 90, 90, 30, 30, 15, 0, 0, 40601, 40291, 129902),
    Array(1073030, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1073032, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1073033, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1073034, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902),
    Array(1073035, 999, 50, 50, 50, 50, 30, 30, 10, 0, 0, 40601, 40291, 129902)
);
//150级武器
var weaponlist = new Array(
        // 法弗纳武器
    Array(1580063, 400, 60, 60, 60, 60, 139, 221, 0, 10, 0, 40601, 40291, 129902),
    Array(1212063, 400, 60, 60, 60, 60, 139, 221, 0, 10, 0, 40601, 40291, 129902),
    Array(1222058, 400, 60, 60, 60, 60, 148, 20, 0, 10, 0, 40601, 40291, 129902),
    Array(1232057, 400, 60, 60, 60, 60, 179, 20, 0, 10, 0, 40601, 40291, 129902),
    Array(1280060, 400, 60, 60, 60, 60, 148, 20, 0, 10, 0, 40601, 40291, 129902),
    Array(1302275, 400, 60, 60, 60, 60, 184, 20, 0, 10, 0, 40601, 40291, 129902),
    Array(1312153, 400, 60, 60, 60, 60, 184, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1322203, 400, 60, 60, 60, 60, 184, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1332225, 400, 60, 60, 60, 60, 180, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1380082, 400, 60, 60, 60, 60, 101, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1362090, 400, 60, 60, 60, 60, 184, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1372177, 400, 60, 60, 60, 60, 139, 221, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1382208, 400, 60, 60, 60, 60, 146, 224, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1402196, 400, 60, 60, 60, 60, 191, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1412135, 400, 60, 60, 60, 60, 191, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1422140, 400, 60, 60, 60, 60, 191, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1432167, 400, 60, 60, 60, 60, 191, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1442223, 400, 60, 60, 60, 60, 173, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1452205, 400, 60, 60, 60, 60, 180, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1462193, 400, 60, 60, 60, 60, 184, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1472214, 400, 60, 60, 60, 60, 106, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1482168, 400, 60, 60, 60, 60, 148, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1492179, 400, 60, 60, 60, 60, 145, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1522094, 400, 60, 60, 60, 60, 180, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1532098, 400, 60, 60, 60, 60, 205, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1252015, 400, 60, 60, 60, 60, 139, 221,0, 10, 0, 40601, 40291, 129902 )
    );
//160级武器
var coatlist = new Array(
    // 160 埃苏莱布斯 武器
	Array(1552110, 1299, 80, 80, 80, 80, 163, 261, 0, 10, 0, 40601, 40291, 129902 ),
	Array(1542108, 1299, 80, 80, 80, 80, 163, 261, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1212115, 1299, 80, 80, 80, 80, 163, 261, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1222109, 1299, 80, 80, 80, 80, 174, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1232109, 1299, 80, 80, 80, 80, 225, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1242116, 1299, 80, 80, 80, 80, 174, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1302333, 1299, 80, 80, 80, 80, 217, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1312199, 1299, 80, 80, 80, 80, 217, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1322250, 1299, 80, 80, 80, 80, 217, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1332274, 1299, 80, 80, 80, 80, 212, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1342101, 1299, 80, 80, 80, 80, 117, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1362135, 1299, 80, 80, 80, 80, 217, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1372222, 1299, 80, 80, 80, 80, 163, 261, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1382259, 1299, 80, 80, 80, 80, 171, 265, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1402251, 1299, 80, 80, 80, 80, 225, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1412177, 1299, 80, 80, 80, 80, 225, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1422184, 1299, 80, 80, 80, 80, 225, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1432214, 1299, 80, 80, 80, 80, 225, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1442268, 1299, 80, 80, 80, 80, 204, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1452252, 1299, 80, 80, 80, 80, 212, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1462239, 1299, 80, 80, 80, 80, 217, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1472261, 1299, 80, 80, 80, 80, 123, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1482216, 1299, 80, 80, 80, 80, 174, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1492231, 1299, 80, 80, 80, 80, 170, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1522138, 1299, 80, 80, 80, 80, 212, 20, 0, 10, 0, 40601, 40291, 129902 ),
    Array(1532144, 1299, 80, 80, 80, 80, 180, 20, 10, 10, 0, 40601, 40291, 129902 )
);
//点装列表
var cashequiplist = new Array(
    // 戒指
    Array(1112958, 199, 15, 15, 15, 15, 15, 15),
    Array(1112959, 199, 15, 15, 15, 15, 15, 15),
    Array(1112178, 199, 15, 15, 15, 15, 15, 15),
    Array(1112179, 199, 15, 15, 15, 15, 15, 15),
    Array(1112940, 199, 15, 15, 15, 15, 15, 15),
    Array(1112170, 199, 15, 15, 15, 15, 15, 15),
    Array(1112183, 199, 15, 15, 15, 15, 15, 15),
    Array(1112296, 199, 15, 15, 15, 15, 15, 15)
);
//道具卷轴
var uselist = new Array(
    Array(2046577, 20),
    Array(2046578, 20),
    Array(2046579, 20),
    Array(2046580, 20),
    Array(2046763, 20),
    Array(2046764, 20),
    Array(2046765, 20),
    Array(2046766, 20),
    Array(2046913, 40),
    Array(2046914, 40),
    Array(2046173, 40),
    Array(2046996, 100),
    Array(2046997, 100),
    Array(2047818, 100)
);
 // 机器人心脏
var rareitemlist = new Array(
    Array(1662006, 50),
    Array(1672003, 20),
    Array(1672004, 30),
    Array(1672005, 40),
    Array(1672007, 50),
    Array(1672027, 99)
);
// 绝版椅子
var suteplist = new Array(
    Array(3014005, 169),
    Array(3010658, 169),
    Array(3010428, 99),
    Array(3010853, 128),
    Array(3015002, 158),
    Array(3015096, 89),
    Array(3010832, 89),
    Array(3015130, 49),
    Array(3015051, 49),
    Array(3015131, 99),
    Array(3015132, 99),
    Array(3010936, 99),
    Array(3015089, 88),
    Array(3015135, 88),
    Array(30112990, 99),
    Array(3015015, 30),
    Array(3015016, 30),
    Array(3015017, 30),
    Array(3015018, 30),
    Array(3015019, 30),
    Array(3015020, 30),
    Array(3015021, 30),
    Array(3015022, 30),
    Array(3015023, 30),
    Array(3015024, 30),
    Array(3015025, 30),
    Array(3015026, 30),
    Array(3015027, 30),
    Array(3015060, 30),
    Array(3015014, 30),
    Array(3012020, 30),
    Array(3012019, 30),
    Array(3015075, 30),
    Array(3015009, 20)
);


var status = -1;
var text;
var ttt6 ="#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";
var seltype, selindex;
var equiplist;

function start() {
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        cm.dispose();
        return;
    }

    if (status == 0) {
        var rmb = cm.getHyPay(1);
        text = "\t\t\t#e#r- VIP会员消费币商店 -#n\r\n\r\n";
        text += "#b您当前可用消费币: #r" + cm.getHyPay(1) + "#b 元\t #b您已消费消费币: #r" + cm.getHyPay(2) + "#b 元#k\r\n\r\n";
        text += "- #e#d请选择：#n#K\r\n";
        text += "#b#L1#"+ttt6+"极品[150级]防具 #l\t#b#L3#"+ttt6+"极品[160级]防具 #l\r\n";
        text += "#b#L0#"+ttt6+"极品[150级]武器 #l\t#b#L2#"+ttt6+"极品[160级]武器 #l\r\n";
        text += "#b#L4#"+ttt6+"稀有[全属性点装]#l\t#b#L5#"+ttt6+"稀有[道具卷轴] #l\r\n";//
        text += "#b#L6#"+ttt6+"稀有[机器人心脏]#l\t#b#L7#"+ttt6+"稀有[巨无霸椅子] #l\r\n";

        cm.sendOk(text);
    } else if (status == 1) {
        text = "#n 亲爱的VIP玩家,这里是VIP会员商店,使用消费币购买下列极品道具#k\r\n#n本服赞助比例获得,#r[1人民币=1消费币+1000 点卷] #k\r\n#r请选择你需要的道具,鼠标点进去查看道具说明:\r\n\r\n#b";
        seltype = selection;
        if (seltype == 0) {
            equiplist = weaponlist;
        } else if (seltype == 1) {
            equiplist = armorlist;
        } else if (seltype == 2) {
            equiplist = coatlist;
        } else if (seltype == 3) {
            equiplist = caplist;
        } else if (seltype == 4) {
            equiplist = cashequiplist;
        } else if (seltype == 5) {
            equiplist = uselist;
        } else if (seltype == 6) {
            equiplist = rareitemlist;
        } else if (seltype == 7) {
            equiplist = suteplist;
        }
        for (var i in equiplist) {
            text += "#L" + i + "##i" + equiplist[i][0] + "##z" + equiplist[i][0] + "# 价格:" + equiplist[i][1] + "消费币\r\n";
        }
        cm.sendSimple(text);
    } else if (status == 2) {
        selindex = selection;
        var equipinfo = equiplist[selindex];
        text = "#e#r确定要购买下列道具吗？\r\n\r\n#b#i" + equipinfo[0] + "##z" + equipinfo[0] + "# 价格:" + equipinfo[1] + "\r\n\r\n";
        if (seltype < 5) {
            text += "#e#d";
            text += "力量：+" + equipinfo[2] + "\r\n";
            text += "敏捷：+" + equipinfo[3] + "\r\n";
            text += "智力：+" + equipinfo[4] + "\r\n";
            text += "运气：+" + equipinfo[5] + "\r\n";
            text += "攻击：+" + equipinfo[6] + "\r\n";
            text += "魔力：+" + equipinfo[7] + "\r\n";
            if (seltype != 4) {
                text += "可砸卷升级次数：+" + equipinfo[8] + "\r\n";
                text += "已经砸卷升级次数：+" + equipinfo[9] + "\r\n";
                text += "星之力次数：+" + equipinfo[10] + "\r\n";
                text += "潜能1：+BOSS伤害增加\r\n";
                text += "潜能2：+全属性增加\r\n";
                text += "潜能3：+无视防御增加\r\n";
            }
            if (seltype == 0 || seltype == 2) {
                text += "武器伤害上限：+" + equipinfo[14] + "\r\n";
            }
        }
        cm.sendYesNo(text);
    } else if (status == 3) {
        var equipinfo = equiplist[selindex];
        if (cm.getHyPay(1) < equipinfo[1]) {
            cm.sendOk("您的消费币余额不足，请充值后再来购买吧");
            cm.dispose();
            return;
        }
        if (cm.haveSpace(Math.floor(equipinfo[0] / 1000000)) < 1) {
            cm.sendOk("您的包裹空间不足，请清理后再来。");
            cm.dispose();
            return;
        }
        if (seltype < 5) {
            var equip = cm.getItemInfo().getEquipById(equipinfo[0]);
            equip.setStr(equipinfo[2]);
            equip.setDex(equipinfo[3]);
            equip.setInt(equipinfo[4]);
            equip.setLuk(equipinfo[5]);
            equip.setWatk(equipinfo[6]);
            equip.setMatk(equipinfo[7]);
            if (seltype != 4) {
                equip.setUpgradeSlots(equipinfo[8]);
                equip.setLevel(equipinfo[9]);
                equip.setEnhance(equipinfo[10]);
                equip.setPotential1(equipinfo[11]);
                equip.setPotential2(equipinfo[12]);
                equip.setPotential3(equipinfo[13]);
            }
            if (seltype == 0 ||　seltype == 2) {
                equip.setLimitBreak(equipinfo[14]);
            }
            if (equip.isSealedEquip()) {
                equip.setSealedLevel(5);
            }
            equip.setOwner(cm.getPlayer().getName());
            cm.addFromDrop(cm.getC(), equip, true);
            cm.worldMessageItem("『消费币商城』 : 恭喜玩家" + cm.getChar().getName() + "在消费币商城购买成功。", equip);
        } else {
            cm.gainItem(equipinfo[0], 1);
            cm.worldSpouseMessage(0x0F, "『VIP会员商城』 : 玩家" + cm.getChar().getName() + "在VIP会员极品商城购买了 " + cm.getItemName(equipinfo[0]));
        }
        cm.addHyPay(equipinfo[1]);
        cm.sendOk("购买成功~祝你游戏愉快！");
        cm.dispose();
    }
}
